home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
hp48hor1
/
frac.doc
< prev
next >
Wrap
Text File
|
1995-03-31
|
2KB
|
45 lines
Author: Dave Vomocil
The attached programs can be used to turn your HP48SX into a four function
RPN machine that handles fractions graphically. That is, you will be able
perform computations on mixed numbers the way you did in grade school. The
pieces (i.e. files/programs) you need are:
GCD computes greatest common divisor
LCM computes least common multiple
PLUS used to add two mixed numbers
SUBTR used to subtract two mixed numbers
MULTI used to multiply two mixed numbers
DIVI used to divide two mixed numbers
DPLAY used to display a mixed number
SWAPR used to 'swap' two mixed numbers on the stack
DISPL common display code used by DPLAY, PLUS, SUBTR, etc.
ADD$ common arithmetic code used by PLUS and SUBTR.
KEYS this is a list you can hand to STOK to assign values to your 'user'
keys.
How to do fractions:
The software looks to the stack for arguments. It uses three levels to
define a mixed number. It wants the whole number in level three, the
numerator in level two, and the denominator in level one.
The operators '+', '-', '*', '/' and 'swap' expect two mixed numbers on the
stack. The arithmetic operators leave only the result on the stack.
The <left shift> <review> operator displays the mixed number in levels 1,
2, & 3; and leaves it the stack unchanged.
Example:
Press: 1 <spc> 2 <spc> 3 <enter> <left shift> <review>; see one and two
thirds displayed. Then press 4 <spc> 5 <spc> 6 + ; see one and two thirds
plus four and five sixths equals six and one half.
Bugs:
The whole number must be positive. The software does not handle a negative
mixed number correctly. For example, it says six and one half plus a
negative three and on half equals four.
by dave vomocil